<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var text = "shuangshaungzuibang";
        function message(){
            try{
                aleert(text);
            }catch(error){
                text = "本页有一个错误！\n\n";
                text+="error info: " + error.message + "\n\n";
                text+="click to continue.\n\n";
                alert(text);
            }finally{
                alert("双双最棒啦！")
            }
        }
    </script>
    <button type="button" value="click me" onclick="message()">click me</button>
<!-- ________________________________________________________________________________________ -->
    <p>请输出一个 5 到 10 之间的数字:</p>
    <input id="demo" type="text">
    <button type="button" onclick="myFunction()">测试输入</button>
    <p id="message"></p>
    <script>
        function myFunction(){
            var message, x;
            message=document.getElementById("message");
            message.innerHTML="";
            x = document.getElementById("demo").value;
            try{
                if(x=="") throw "input is null!";
                if(isNaN(x)) throw "is not number!";
                x=Number(x);
                if(x<5) throw "too small!";
                if(x>10) throw "too large";
            }catch(err){
                message.innerHTML="error: " + err; 
            }
        }
    </script>
<!-- _______________________________________________________________________________________ -->
<p id="shuang"></p>
<script>
    var str = " document.write('string')";
    document.write(str);
    document.getElementById("shuang").innerHTML="document.getElementById('idname').innerHTML";
    console.log("console.log() 输出")
</script>

</body>
</html>